package demo1;

/**
 * @Author liangzai
 * @Description:
 */
public class Computer {
    public void open(){
        System.out.println("打开电脑");
    }

    public void useUsbDevice(Usb usb){
        usb.openDevice();
        if(usb instanceof Mouse){
            Mouse mouse = (Mouse) usb;
            mouse.cilk();
        }else{
            Keybored keybored = (Keybored) usb;
            keybored.cilk();
        }
        usb.closeDevice();
    }


    public void close(){
        System.out.println("关闭电脑");
    }
}
